const path = require("path"); // 引入path模块
function resolve(dir) {
  return path.join(__dirname, dir); // path.join(__dirname)设置绝对路径
}

module.exports = {
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  chainWebpack: (config) => {
    // 给路径起别名
    config.resolve.alias
      .set("@", resolve("./src"))
      .set("~", resolve("src/assets/overall/components"));
    // .set('设置的别名',resolve('设置的路径'))
  },
  css: {
    loaderOptions: {
      sass: {
        additionalData: `
          @import "./src/assets/overall/css/overall.scss";
        `,
      },
    },
  }
};
